home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra_2 / asm106.zip / ASKASCII.ASM next >
Assembly Source File  |  1995-11-09  |  2KB  |  90 lines

  1. ; +----------------------------------------------------------+ ;
  2. ; | Sample ASKASCII program for use with the Magic Assembler | ;
  3. ; +----------------------------------------------------------+ ;
  4.         
  5.         mov     ah,09
  6.         mov     dx,offset(headtxt)
  7.         int     21
  8.         mov     dx,offset(crlf)
  9.         int     21
  10. @5      mov     ah,09
  11.         mov     dx,offset(quest)
  12.         int     21
  13.         mov     ah,00
  14.         int     16
  15.         push    ax
  16.         mov     ah,0e
  17.         mov     bh,00
  18.         int     10
  19.         mov     ah,09
  20.         mov     dx,offset(a1)
  21.         int     21
  22.         pop     ax
  23.         push    ax
  24.         mov     al,ah
  25.         call    wrtnum
  26.         mov     ah,09
  27.         mov     dx,offset(a2)
  28.         int     21
  29.         pop     ax
  30.         push    ax
  31.         call    wrtnum
  32.         mov     ah,09
  33.         mov     dx,offset(crlf)
  34.         int     21
  35.         mov     ah,0a
  36.         mov     al,'─'
  37.         mov     bh,00
  38.         mov     cx,50
  39.         int     10
  40.         mov     ah,09
  41.         mov     cx,offset(crlf)
  42.         int     21
  43.         pop     ax
  44.         cmp     ax,011b
  45.         jne     @5
  46.         int     20
  47.  
  48. wrtnum  mov     ah,00
  49.         mov     bl,64
  50.         div     bl
  51.         cmp     al,00
  52.         je      @1
  53.         push    ax
  54.         mov     ah,0e
  55.         add     al,30
  56.         mov     bh,00
  57.         int     10
  58.         pop     ax
  59.         mov     cl,01
  60.         jmps    @2
  61. @1      mov     cl,00
  62. @2      mov     al,ah
  63.         mov     ah,00
  64.         mov     bl,0a
  65.         div     bl
  66.         cmp     cl,00
  67.         jne     @3
  68.         cmp     al,00
  69.         je      @4
  70. @3      push    ax
  71.         mov     ah,0e
  72.         add     al,30
  73.         mov     bh,00
  74.         int     10
  75.         pop     ax
  76. @4      mov     al,ah
  77.         add     al,30
  78.         mov     ah,0e
  79.         mov     bh,00
  80.         int     10
  81.         ret
  82.  
  83. a1      db      0a 0d 'Scan code: $'
  84. a2      db      '; ASCII code: $'
  85. crlf    db      0a 0d '$'
  86. headtxt db      'Ask ASCII - Written by Bert Greevenbosch for Magic Software' 0a 0d 
  87.         db      'Public Domain Version' 0a 0d '$'
  88. quest   db      'Enter character to give ASCII code for (ESC quits): $'
  89.  
  90.